<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>
<body>
<script>
var arr =[1,2,2,2,2,3,3,4,2,2,4,4,4];
//循环去重
//for(var i=0;i<arr.length-1;i++){
//	for(var j=i+1;j<arr.length;j++){
//		if(arr[i]==arr[j]){
//			arr.splice(j,1);
//			j--;
//		}
//	}
//}
//console.log(arr);

//ES6去重
//var arr1=[...new Set(arr)]
//console.log(arr1);

//indexof去重
//var l=[];
//for(var i=0;i<arr.length;i++){
//if(l.indexOf(arr[i])===-1){
//    l.push(arr[i]);
//}
//}
//console.log(l);


</script>
</body>
</html>
